<?php if ($auth_user->hasAttribute('photo')): ?>
    <?php slot('photo') ?>
    <img src="<?php echo $auth_user->getAttribute('photo'); ?>" width="105px">
    <?php end_slot(); ?>
<?php endif; ?>

<?php slot('user_name') ?>
<div id="layout_user_name">
    <?php echo $full_name; ?>
</div>
<?php end_slot(); ?>

<br>
<?php
if (!$error) {
    ?>
    <div id="id_user" id_user="<?php echo $user->getId(); ?>" style="display:none;"></div>
    <div id="providers_window">
        <div id="my_providers">
            <div class="current_provider"
                 id="<?php echo $my_current_provider->getId(); ?>"
                 >
                     <?php
                     echo $my_current_provider->getFirstName() . ' ' . $my_current_provider->getLastName() .
                     ' (current)<br>' . $my_current_provider->getIdentity();
                     ?>
            </div>
            <?php foreach ($my_providers as $provider):
                ?>
                <div class="provider"
                     id="<?php echo $provider->getId(); ?>"
                     >
                         <?php
                         if ($provider->getFirstName() != null) {
                             $user_name = $provider->getFirstName() . ' ' . $provider->getLastName() .
                                                     '<br>' . $provider->getIdentity();
                         } else if ($provider->getEmail() != null) {
                             $user_name = $provider->getEmail() . '<br>' . $provider->getIdentity();
                         } else {
                             $user_name = $provider->getIdentity();
                         }
                         echo $user_name;
                         ?>

                    <div class="close"
                         id_provider="<?php echo $provider->getId(); ?>"
                         onclick="removeBtn(this);"
                         >
                        x
                    </div>

                </div>
            <?php endforeach; ?>
        </div>
        <div>
            <input type="button" value="Add new provider" onclick="addProfile();" id="addBtn">
        </div>
    </div>

    <!-- new loginza widget, layout's widget deleting by js, because there is needs over loginza-token_url path -->
    <div id="loginza_widget_new">
        <iframe src="<?php echo sfConfig::get('app_LoginzaPlugin_loginza_url') . sfConfig::get('app_LoginzaPlugin_providers') . '&token_url=' . sfConfig::get('app_LoginzaPlugin_my_host') . '/lzprofile/overproviders'; ?>" 
                style="width:359px;height:300px;" scrolling="no" frameborder="no">
        </iframe>
    </div>
    <?php
} else {
    echo $error;
}
?>
